load(
    "//tools:defaults.bzl",
    "markdown_to_html",
    "ng_module",
    "ng_test_library",
    "ng_web_test_suite",
    "sass_binary",
    "sass_library",
)

package(default_visibility = ["//visibility:public"])

ng_module(
    name = "list",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
        ],
    ),
    assets = [
        ":list_scss",
        ":list_option_scss",
    ] + glob(["**/*.html"]),
    deps = [
        "//src:dev_mode_types",
        "//src/cdk/coercion",
        "//src/cdk/collections",
        "//src/cdk/observers",
        "//src/material/core",
        "//src/material/divider",
        "@npm//@angular/core",
        "@npm//@angular/forms",
    ],
)

sass_library(
    name = "hcm_indicator_scss_lib",
    srcs = ["_list-item-hcm-indicator.scss"],
    deps = [
        "//:mdc_sass_lib",
    ],
)

sass_library(
    name = "list_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        ":hcm_indicator_scss_lib",
        "//:mdc_sass_lib",
        "//src/material/checkbox:checkbox_scss_lib",
        "//src/material/core:core_scss_lib",
        "//src/material/radio:radio_scss_lib",
    ],
)

sass_binary(
    name = "list_scss",
    src = "list.scss",
    deps = [
        ":hcm_indicator_scss_lib",
        "//:mdc_sass_lib",
        "//src/material/core:core_scss_lib",
    ],
)

sass_binary(
    name = "list_option_scss",
    src = "list-option.scss",
    deps = [
        ":list_scss_lib",
        "//:mdc_sass_lib",
        "//src/cdk:sass_lib",
        "//src/material/core:core_scss_lib",
    ],
)

ng_test_library(
    name = "list_tests_lib",
    srcs = glob(
        ["**/*.spec.ts"],
    ),
    deps = [
        ":list",
        "//src/cdk/keycodes",
        "//src/cdk/testing/private",
        "//src/cdk/testing/testbed",
        "//src/material/core",
        "@npm//@angular/forms",
        "@npm//@angular/platform-browser",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [
        ":list_tests_lib",
    ],
)

markdown_to_html(
    name = "overview",
    srcs = [":list.md"],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)
